package cc.eddic.practice.spring.repository;

import cc.eddic.practice.spring.domain.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;
import java.util.List;

public interface StudentRepository extends JpaRepository<Student, Long> {
    @Transactional
    @Modifying
    @Query("DELETE FROM Student s WHERE s.id IN :ids")
    void deleteByIdIn(@Param("ids") List<Long> ids);
}
